package com.venusj.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created By Administrator
 * User: VenusZ
 * Date: on 2020/3/23 21:05
 * Desc: 如果需要使用其他Ribbon  其他算法  需要在启动类之外的包配置对应的配置类
 */
@Configuration
public class MySelfRule {

    @Bean
    public IRule myRule () {
        return new RandomRule();  // 定义为随机的规则
    }
}
